import React from 'react';
import SelectAllOutlined from '@material-ui/icons/SelectAllOutlined';
import { NavView, get_mod, NavListSub, loc } from 'sui';
import { UserView } from './user';
import { GroupView } from './group/view';

const model = (cfg) => {
    const fix = [
        {uid: "stuff.user", view: UserView, value: loc("l_768")},
        {uid: "stuff.group", view: GroupView, value: loc("l_867")},
    ];

    return get_mod(cfg, fix, "stuff");
};

const Stuff = ({ mod, setEvent, sideopen, cfg }) => <NavView cfg={cfg} model={model(cfg)} mod={mod} setEvent={setEvent} sideopen={sideopen} name="stuff"/>;

const NavStuff = (props) => <NavListSub icon={<SelectAllOutlined/>} sub={model(props.cfg)} {...props} scut={15}/>;

export {NavStuff, Stuff};
